// -----------------------------------------------------------------------
// <copyright file="PhoneNumber.cs" company="Imar.Spaanjaars.Com">
//   Copyright 2008 - 2009 - Imar.Spaanjaars.Com. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

using System.ComponentModel;
using System.Diagnostics;
using Spaanjaars.Validation;

namespace Spaanjaars.ContactManager.BusinessEntities
{
	/// <summary>
	/// The PhoneNumber class represents a phone number that belongs to a <see cref="ContactPerson"> contact person</see>.
	/// </summary>
	[DebuggerDisplay("PhoneNumber: {Number, nq} ({Type, nq})")]
	public class PhoneNumber : BusinessBase
	{
		#region Constructor(s)

		/// <summary>
		/// Initializes a new instance of the PhoneNumber class.
		/// </summary>
		public PhoneNumber()
		{
			Type = ContactType.None;
		}

		#endregion

		#region Public Properties

		/// <summary>
		/// Gets or sets the unique ID of the phone number.
		/// </summary>
		[DataObjectFieldAttribute(true, true, false)]
		public override int Id { get; set; }

		/// <summary>
		/// Gets or sets the actual number of the phone number.
		/// </summary>
		[NotNullOrEmpty(Key = "PhoneNumberNotEmpty")]
		public string Number { get; set; }

		/// <summary>
		/// Gets or sets the type of the phone number, like business or personal.
		/// </summary>
		[EnumNotNoneAttribute(Key = "ContactTypeNotNone")]
		public ContactType Type { get; set; }

		/// <summary>
		/// Gets or sets the ID of the owner (a <see cref="ContactPerson"/>) of the phone number.
		/// </summary>
		public int ContactPersonId { get; set; }

		#endregion
	}
}